package com.zzedu.dto;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 班级管理对象 zz_classes
 *
 * @author Mr.Wang
 */
public class ZzClassesDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    private Long id;

    /**
     * 班级名称
     */
    private String name;

    /**
     * 班级类型 1-常规班 2-特殊班
     */
    private Integer clzzType;

    /**
     * 上课频率 clzz_type=1 有值
     */
    private Integer frequency;
    /**
     * 校区ID
     */
    private Long schoolId;

    /**
     * 正常
     */
    private Integer state;

    /**
     * 添加时间
     */
    private LocalDateTime gmtCreate;

    /**
     * 更新时间
     */
    private LocalDateTime gmtModify;

    /**
     * 逻辑删除(0：未删除 1：id)
     */
    private Integer deleted;

    private Long createBy;
    private Long updateBy;

    /**
     * 对应课程
     */
    private String unitIds;

    /**
     * 级别
     */
    private String level;

    /**
     * 班主任ID
     */
    private Long teacherId;
    /**
     * 课表类型
     */
    private Integer timetableType;
    /**
     * 开课日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate openDate;

    /**
     * 上课时间 JSON
     * [
     * {
     * "day":1, // 1-7 周一到周日
     * "dayText":"", //星期几
     * "startTime":"08:00", //开始时间
     * "endTime":"12:00" //结束时间
     * }...
     * ]
     */
    private String cycleStudyDate;
    /**
     * 教室
     */
    private String roomName;

    private Map<String, Object> params;
    /**
     * 当前记录起始索引
     */
    private Long pageNum = 1l;

    /**
     * 每页显示记录数
     */
    private Long pageSize = 20l;

    /**
     * 排序列
     */
    private String orderByColumn;

    /**
     * 排序的方向desc或者asc
     */
    private String isAsc = "asc";

    private List<Long> schoolIdArray;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public LocalDateTime getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(LocalDateTime gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public LocalDateTime getGmtModify() {
        return gmtModify;
    }

    public void setGmtModify(LocalDateTime gmtModify) {
        this.gmtModify = gmtModify;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public Map<String, Object> getParams() {
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }

    public Long getPageNum() {
        return pageNum;
    }

    public void setPageNum(Long pageNum) {
        this.pageNum = pageNum;
    }

    public Long getPageSize() {
        return pageSize;
    }

    public void setPageSize(Long pageSize) {
        this.pageSize = pageSize;
    }

    public String getOrderByColumn() {
        return orderByColumn;
    }

    public void setOrderByColumn(String orderByColumn) {
        this.orderByColumn = orderByColumn;
    }

    public String getIsAsc() {
        return isAsc;
    }

    public void setIsAsc(String isAsc) {
        this.isAsc = isAsc;
    }

    public List<Long> getSchoolIdArray() {
        return schoolIdArray;
    }

    public void setSchoolIdArray(List<Long> schoolIdArray) {
        this.schoolIdArray = schoolIdArray;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Long getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }

    public String getUnitIds() {
        return unitIds;
    }

    public void setUnitIds(String unitIds) {
        this.unitIds = unitIds;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public Long getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(Long teacherId) {
        this.teacherId = teacherId;
    }

    public Integer getTimetableType() {
        return timetableType;
    }

    public void setTimetableType(Integer timetableType) {
        this.timetableType = timetableType;
    }

    public LocalDate getOpenDate() {
        return openDate;
    }

    public void setOpenDate(LocalDate openDate) {
        this.openDate = openDate;
    }

    public String getCycleStudyDate() {
        return cycleStudyDate;
    }

    public void setCycleStudyDate(String cycleStudyDate) {
        this.cycleStudyDate = cycleStudyDate;
    }

    public String getRoomName() {
        return roomName;
    }

    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    public IPage getPageDTO() {
        return PageDTO.of(getPageNum(), getPageSize());
    }

    public Integer getClzzType() {
        return clzzType;
    }

    public void setClzzType(Integer clzzType) {
        this.clzzType = clzzType;
    }

    public Integer getFrequency() {
        return frequency;
    }

    public void setFrequency(Integer frequency) {
        this.frequency = frequency;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
    }
}
